package t25421;

public class Main {
    public static void main(String[] args) {
        // 声明Vehicle类型的数组
        Vehicle[] vehicles = new Vehicle[3];
        // 创建Car和Bike对象并存储到数组中
        vehicles[0] = new Car("宝马", "X5");
        vehicles[1] = new Bike("捷安特", "ATX 830");
        vehicles[2] = new Car("奔驰", "C级");

        // 遍历数组并调用drive方法
        for (Vehicle vehicle : vehicles) {
            vehicle.drive();
        }
    }
}
